import 'package:get/get.dart';
import 'package:pet_app/model/enums/article_type.dart';
import 'package:pet_app/model/enums/pet_type.dart';
import 'package:pet_app/routes/router.dart';
import 'package:pet_app/views/home/logic.dart';

class MenuPanelLogic extends GetxController {

  late String img;

  late PetType petType;

  @override
  void onInit() {
    super.onInit();
    HomeLogic homeLogic = Get.find();
    img = homeLogic.img;
    petType = homeLogic.petType;
  }

  @override
  void dispose() {
    super.dispose();
  }

  void toListPage(ArticleType type) {
    PetType petType = this.petType;
    if (type == ArticleType.breed) {
      Get.toNamed(AppRoutes.breedGroup, arguments: {'petType': petType});
    }else if (type == ArticleType.breedSearch) {
      Get.toNamed(AppRoutes.breedSearch, arguments: {'petType': petType});
    } else {
      Get.toNamed(AppRoutes.article,
          arguments: {'type': type, 'petType': petType});
    }
  }
}
